package com.xiaoyy.app.extend.gateway.controller;

import cn.hutool.core.convert.Convert;
import com.xiaoyy.app.extend.common.vo.zlbsendmsg.ZLBSendMSGVO;
import com.xiaoyy.app.extend.gateway.req.zlbsendmsg.ZLBSendMSGReq;
import com.xiaoyy.app.extend.integration.ZLBFuncDockingIntegration;
import com.xiaoyy.core.common.vo.AppResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/app/zlb/")
@Api(tags = "浙里办通知消息发送")
public class ZLBSendMsgController {
    @Autowired
    private ZLBFuncDockingIntegration zlbFuncDockingIntegration;

    @PostMapping(value = "/msg/send", produces = "application/json;charset=UTF-8")
    @ApiOperation(value = "浙里办通知消息发送", notes = "浙里办通知消息发送")
    public AppResponse send(@RequestBody @Validated ZLBSendMSGReq req){
        ZLBSendMSGVO vo = Convert.convert(ZLBSendMSGVO.class,req);
        zlbFuncDockingIntegration.sendMessage(vo);
        return AppResponse.success();
    }
}
